package com.atguigu.tingshu.album.mapper;

import com.atguigu.tingshu.model.album.BaseAttribute;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BaseAttributeMapper extends BaseMapper<BaseAttribute> {


    /**
     * 根据一级分类id查询属性集合数据
     * @param category1Id
     * @return
     */
    //    @Select("select\n" +
    //            "    ba.id,\n" +
    //            "    ba.attribute_name,\n" +
    //            "    ba.category1_id,\n" +
    //            "    bav.id attribute_value_id,\n" +
    //            "    bav.attribute_id,\n" +
    //            "    bav.value_name\n" +
    //            "    from base_attribute ba inner join base_attribute_value bav on ba.id = bav.attribute_id\n" +
    //            "where ba.category1_id = #{category1Id} and ba.is_deleted = 0")
    List<BaseAttribute> selectAttribute(@Param("category1Id") Long category1Id);

}
